<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="utf-8">
<!-- qpixmap.cpp -->
  <title>Obsolete Members for QPixmap | Qt GUI 5.14.2</title>
  <link rel="stylesheet" type="text/css" href="style/offline-simple.css" />
  <script type="text/javascript">
    document.getElementsByTagName("link").item(0).setAttribute("href", "style/offline.css");
    // loading style sheet breaks anchors that were jumped to before
    // so force jumping to anchor again
    setTimeout(function() {
        var anchor = location.hash;
        // need to jump to different anchor first (e.g. none)
        location.hash = "#";
        setTimeout(function() {
            location.hash = anchor;
        }, 0);
    }, 0);
  </script>
</head>
<body>
<div class="header" id="qtdocheader">
  <div class="main">
    <div class="main-rounded">
      <div class="navigationbar">
        <table><tr>
<td ><a href="../qtdoc/index.html">Qt 5.14</a></td><td ><a href="qtgui-index.html">Qt GUI</a></td><td ><a href="qtgui-module.html">C++ Classes</a></td><td >QPixmap</td></tr></table><table class="buildversion"><tr>
<td id="buildversion" width="100%" align="right"><a href="qtgui-index.html">Qt 5.14.2 Reference Documentation</a></td>
        </tr></table>
      </div>
    </div>
<div class="content">
<div class="line">
<div class="content mainContent">
<div class="sidebar"><div class="sidebar-content" id="sidebar-content"></div></div>
<h1 class="title">Obsolete Members for QPixmap</h1>
<p><b>The following members of class <a href="qpixmap.html">QPixmap</a> are obsolete.</b> They are provided to keep old source code working. We strongly advise against using them in new code.</p>
<h2>Public Functions</h2>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> <code>(obsolete) </code>void </td><td class="memItemRight bottomAlign"><b><a href="qpixmap-obsolete.html#fill-1">fill</a></b>(const QPaintDevice *<i>device</i>, const QPoint &amp;<i>p</i>)</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> <code>(obsolete) </code>void </td><td class="memItemRight bottomAlign"><b><a href="qpixmap-obsolete.html#fill-2">fill</a></b>(const QPaintDevice *<i>device</i>, int <i>x</i>, int <i>y</i>)</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> <code>(obsolete) </code>int </td><td class="memItemRight bottomAlign"><b><a href="qpixmap-obsolete.html#serialNumber">serialNumber</a></b>() const</td></tr>
</table></div>
<h2>Static Public Members</h2>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> <code>(obsolete) </code>QPixmap </td><td class="memItemRight bottomAlign"><b><a href="qpixmap-obsolete.html#grabWidget">grabWidget</a></b>(QObject *<i>widget</i>, const QRect &amp;<i>rectangle</i>)</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> <code>(obsolete) </code>QPixmap </td><td class="memItemRight bottomAlign"><b><a href="qpixmap-obsolete.html#grabWidget-1">grabWidget</a></b>(QObject *<i>widget</i>, int <i>x</i> = 0, int <i>y</i> = 0, int <i>w</i> = -1, int <i>h</i> = -1)</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> <code>(obsolete) </code>QPixmap </td><td class="memItemRight bottomAlign"><b><a href="qpixmap-obsolete.html#grabWindow">grabWindow</a></b>(WId <i>window</i>, int <i>x</i> = 0, int <i>y</i> = 0, int <i>width</i> = -1, int <i>height</i> = -1)</td></tr>
</table></div>
<h2>Member Function Documentation</h2>
<!-- $$$fill$$$fillconstQPaintDevice*constQPoint& -->
<h3 class="fn" id="fill-1"><a name="fill-1"></a><span class="type">void</span> QPixmap::<span class="name">fill</span>(const <span class="type"><a href="qpaintdevice.html#QPaintDevice">QPaintDevice</a></span> *<i>device</i>, const <span class="type"><a href="../qtcore/qpoint.html">QPoint</a></span> &amp;<i>p</i>)</h3>
<p>This function is obsolete. It is provided to keep old source code working. We strongly advise against using it in new code.</p>
<p>Use <a href="qpainter.html">QPainter</a> or the fill(<a href="qcolor.html">QColor</a>) overload instead.</p>
<!-- @@@fill -->
<!-- $$$fill$$$fillconstQPaintDevice*intint -->
<h3 class="fn" id="fill-2"><a name="fill-2"></a><span class="type">void</span> QPixmap::<span class="name">fill</span>(const <span class="type"><a href="qpaintdevice.html#QPaintDevice">QPaintDevice</a></span> *<i>device</i>, <span class="type">int</span> <i>x</i>, <span class="type">int</span> <i>y</i>)</h3>
<p>This function is obsolete. It is provided to keep old source code working. We strongly advise against using it in new code.</p>
<p>Use <a href="qpainter.html">QPainter</a> or the fill(<a href="qcolor.html">QColor</a>) overload instead.</p>
<!-- @@@fill -->
<!-- $$$grabWidget[overload1]$$$grabWidgetQObject*constQRect& -->
<h3 class="fn" id="grabWidget"><a name="grabWidget"></a><code>[static] </code><span class="type"><a href="qpixmap.html#QPixmap">QPixmap</a></span> QPixmap::<span class="name">grabWidget</span>(<span class="type"><a href="../qtcore/qobject.html">QObject</a></span> *<i>widget</i>, const <span class="type"><a href="../qtcore/qrect.html">QRect</a></span> &amp;<i>rectangle</i>)</h3>
<p>This function is obsolete. It is provided to keep old source code working. We strongly advise against using it in new code.</p>
<p>Use <a href="../qtwidgets/qwidget.html#grab">QWidget::grab</a>() instead.</p>
<!-- @@@grabWidget -->
<!-- $$$grabWidget$$$grabWidgetQObject*intintintint -->
<h3 class="fn" id="grabWidget-1"><a name="grabWidget-1"></a><code>[static] </code><span class="type"><a href="qpixmap.html#QPixmap">QPixmap</a></span> QPixmap::<span class="name">grabWidget</span>(<span class="type"><a href="../qtcore/qobject.html">QObject</a></span> *<i>widget</i>, <span class="type">int</span> <i>x</i> = 0, <span class="type">int</span> <i>y</i> = 0, <span class="type">int</span> <i>w</i> = -1, <span class="type">int</span> <i>h</i> = -1)</h3>
<p>This function is obsolete. It is provided to keep old source code working. We strongly advise against using it in new code.</p>
<p>Use <a href="../qtwidgets/qwidget.html#grab">QWidget::grab</a>() instead.</p>
<!-- @@@grabWidget -->
<!-- $$$grabWindow[overload1]$$$grabWindowWIdintintintint -->
<h3 class="fn" id="grabWindow"><a name="grabWindow"></a><code>[static] </code><span class="type"><a href="qpixmap.html#QPixmap">QPixmap</a></span> QPixmap::<span class="name">grabWindow</span>(<span class="type">WId</span> <i>window</i>, <span class="type">int</span> <i>x</i> = 0, <span class="type">int</span> <i>y</i> = 0, <span class="type">int</span> <i>width</i> = -1, <span class="type">int</span> <i>height</i> = -1)</h3>
<p>This function is obsolete. It is provided to keep old source code working. We strongly advise against using it in new code.</p>
<p>Creates and returns a pixmap constructed by grabbing the contents of the given <i>window</i> restricted by <a href="../qtcore/qrect.html">QRect</a>(<i>x</i>, <i>y</i>, <i>width</i>, <i>height</i>).</p>
<p>The arguments (<i>x</i>, <i>y</i>) specify the offset in the window, whereas (<i>width</i>, <i>height</i>) specify the area to be copied. If <i>width</i> is negative, the function copies everything to the right border of the window. If <i>height</i> is negative, the function copies everything to the bottom of the window.</p>
<p>The window system identifier (<code>WId</code>) can be retrieved using the <a href="../qtwidgets/qwidget.html#winId">QWidget::winId</a>() function. The rationale for using a window identifier and not a <a href="../qtwidgets/qwidget.html">QWidget</a>, is to enable grabbing of windows that are not part of the application, window system frames, and so on.</p>
<p>The grabWindow() function grabs pixels from the screen, not from the window, i.e&#x2e; if there is another window partially or entirely over the one you grab, you get pixels from the overlying window, too. The mouse cursor is generally not grabbed.</p>
<p>Note on X11 that if the given <i>window</i> doesn't have the same depth as the root window, and another window partially or entirely obscures the one you grab, you will <i>not</i> get pixels from the overlying window. The contents of the obscured areas in the pixmap will be undefined and uninitialized.</p>
<p>On Windows Vista and above grabbing a layered window, which is created by setting the <a href="../qtcore/qt.html#WidgetAttribute-enum">Qt::WA_TranslucentBackground</a> attribute, will not work. Instead grabbing the desktop widget should work.</p>
<p><b>Warning:</b> In general, grabbing an area outside the screen is not safe. This depends on the underlying window system.</p>
<p><b>Warning:</b> The function is deprecated in Qt 5.0 since there might be platform plugins in which window system identifiers (<code>WId</code>) are local to a screen. Use <a href="qscreen.html#grabWindow">QScreen::grabWindow</a>() instead.</p>
<p><b>See also </b><a href="qpixmap-obsolete.html#grabWidget">grabWidget</a>(), <a href="../qtwidgets/qtwidgets-desktop-screenshot-example.html">Screenshot Example</a>, and <a href="qscreen.html">QScreen</a>.</p>
<!-- @@@grabWindow -->
<!-- $$$serialNumber[overload1]$$$serialNumber -->
<h3 class="fn" id="serialNumber"><a name="serialNumber"></a><span class="type">int</span> QPixmap::<span class="name">serialNumber</span>() const</h3>
<p>This function is obsolete. It is provided to keep old source code working. We strongly advise against using it in new code.</p>
<p>Returns a number that identifies the contents of this <a href="qpixmap.html">QPixmap</a> object. Distinct <a href="qpixmap.html">QPixmap</a> objects can only have the same serial number if they refer to the same contents (but they don't have to).</p>
<p>Use <a href="qpixmap.html#cacheKey">cacheKey</a>() instead.</p>
<p><b>Warning:</b> The serial number doesn't necessarily change when the pixmap is altered. This means that it may be dangerous to use it as a cache key. For caching pixmaps, we recommend using the <a href="qpixmapcache.html">QPixmapCache</a> class whenever possible.</p>
<!-- @@@serialNumber -->
        </div>
       </div>
   </div>
   </div>
</div>
<div class="footer">
   <p>
   <acronym title="Copyright">&copy;</acronym> 2020 The Qt Company Ltd.
   Documentation contributions included herein are the copyrights of
   their respective owners.<br/>    The documentation provided herein is licensed under the terms of the    <a href="http://www.gnu.org/licenses/fdl.html">GNU Free Documentation    License version 1.3</a> as published by the Free Software Foundation.<br/>    Qt and respective logos are trademarks of The Qt Company Ltd.     in Finland and/or other countries worldwide. All other trademarks are property
   of their respective owners. </p>
</div>
</body>
</html>
